package com.pitaya.winwine.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "tb_taste")
public class Taste implements Serializable{

	private static final long serialVersionUID = -7306256513004316880L;

	@Id @GeneratedValue
	private Integer id;
	
	private String chName;
	private String enName;
	private Integer vintage;
	private Integer rating;
	private String comment;
	
	@OneToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
  	@JoinColumn(name = "userId")
	private User user;
	@Column(insertable = false, updatable = false)
	private Integer userId;
	private Date createTime;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getChName() {
		return chName;
	}
	public void setChName(String chName) {
		this.chName = chName;
	}
	public String getEnName() {
		return enName;
	}
	public void setEnName(String enName) {
		this.enName = enName;
	}
	public Integer getVintage() {
		return vintage;
	}
	public void setVintage(Integer vintage) {
		this.vintage = vintage;
	}
	public Integer getRating() {
		return rating;
	}
	public void setRating(Integer rating) {
		this.rating = rating;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
}
